<%-- 
    Document   : config
    Created on : 2016-3-4, 14:49:04
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="${base}/css/bootstrap-paper.css" rel="stylesheet">
        <link href="${base}/css/font-awesome.css" rel="stylesheet">

        <script type="text/javascript" src="${base}/js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="${base}/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="${base}/js/jquery.cxhd.js"></script>
        <script type="text/javascript" src="${base}/js/angular/angular.min.js"></script>
        <title>配置</title>
    </head>
    <body  ng-app="dataConfig" ng-controller="mainCtrl">

        <div class="container">

            <div class="panel panel-default">
                <div class="panel-heading">参数配置
                    <button ng-click="saveConfig()" style="float: right" class="btn btn-success btn-sm "><span class="fa fa-save"></span>保存</button></div>
                <div class="panel-body">
                    <form class="form-horizontal" >
                        <div class="col-lg-6">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">开启缓存</label>

                                <div class="col-sm-10">
                                    <input ng-model="config.cacheFlag" type="checkbox" >
                                </div>
                            </div> 
                        </div>
                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">缓存路劲</label>

                                <div class="col-sm-10">
                                    <input ng-model="config.cachePath" type="text" class="form-control">
                                </div>
                            </div> 
                        </div>
                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">医院名称</label>

                                <div class="col-sm-10">
                                    <input ng-model="config.hospitalName" type="text" class="form-control">
                                </div>
                            </div> 
                        </div>

                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">转诊地址</label>

                                <div class="col-sm-10">
                                    <input ng-model="config.zjurl" type="text" class="form-control">
                                </div>
                            </div> 
                        </div>
                        <!--                        <div class="col-lg-12 ">
                                                    <div class="form-group">
                                                        <label class="col-sm-2 control-label">插件注册</label>
                        
                                                        <div class="col-sm-10">
                                                            <textarea style="height: 100px;" ng-model="config.pluginList" type="text" class="form-control"></textarea>
                                                        </div>
                                                    </div> 
                                                </div>-->

                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">短信地址</label>

                                <div class="col-sm-10">
                                    <input  ng-model="config.smsurl" type="text" class="form-control"/>
                                </div>
                            </div> 
                        </div>
                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">启动短信</label>

                                <div class="col-sm-10">
                                    <input  ng-model="config.smsflag" type="checkbox"/>
                                </div>
                            </div> 
                        </div>
                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">视频地址</label>

                                <div class="col-sm-10">
                                    <input  ng-model="config.videoUrl" type="text" class="form-control"/>
                                </div>
                            </div> 
                        </div>
                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">DICOM工作站</label>

                                <div class="col-sm-10">
                                    <input  ng-model="config.dicomServerUrl" type="text" class="form-control"/>
                                </div>
                            </div> 
                        </div>
                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">DICOM服务路径</label>

                                <div class="col-sm-10">
                                    <input  ng-model="config.dicomServerPath" type="text" class="form-control"/>
                                </div>
                            </div> 
                        </div>
                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">CXFS</label>

                                <div class="col-sm-10">
                                    <input  ng-model="config.cxfsUrl" type="text" class="form-control"/>
                                </div>
                            </div> 
                        </div>
                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">外网地址</label>

                                <div class="col-sm-10">
                                    <input  ng-model="config.localUrl" type="text" class="form-control"/>
                                </div>
                            </div> 
                        </div>
                        
                         <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">登陆地址</label>

                                <div class="col-sm-10">
                                    <input  ng-model="config.loginUrl" type="text" class="form-control"/>
                                </div>
                            </div> 
                        </div>
                        
                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">系统名称</label>

                                <div class="col-sm-10">
                                    <input  ng-model="config.systemName" type="text" class="form-control"/>
                                </div>
                            </div> 
                        </div>
                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">中心医院代码</label>

                                <div class="col-sm-10">
                                    <input  ng-model="config.centerHospitalCode" type="text" class="form-control"/>
                                </div>
                            </div> 
                        </div>
                        <div class="col-lg-6 ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">系统模式</label>

                                <div class="col-sm-10">
                                    <input  ng-model="config.system_mode" type="text" class="form-control"/>
                                </div>
                            </div> 
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </body>

    <script type="text/javascript">

        angular.module("dataConfig", [])

                .controller("mainCtrl", function ($scope) {
                    var so = $scope;
                    so.config = {};
                    so.saveConfig = function () {
                        steveConfrim("确定保存吗？", function () {
                            $.post("config/saveConfig", so.config, function (data) {
                                if (data == 'true') {
                                    steveAl("保存成功", 1000);
                                } else {
                                    steveAl("保存失败", 1000);
                                }
                            })
                        }, true);

                    }
                    so.getConfig = function () {
                        $.post("config/getConfig", function (data) {
                            if (data) {
                                for (s in data) {
                                    if (data[s] == "true") {
                                        data[s] = true;
                                    }
                                }
                            }
                            so.config = data;

//                    if (so.config.autoTask == 'true') {
//                        so.config.autoTask = true;
//                    }
//                    if (so.config.returnReportFlag == 'true') {
//                        so.config.returnReportFlag = true;
//                    }
//                    if (so.config.sendMessageFlag == 'true') {
//                        so.config.sendMessageFlag = true;
//                    }
                            so.$apply();
                        });
                    }


                    so.getConfig();

                })
    </script>
</html>
